'''
Created on 3/07/2010

@author: zainul
'''
import unittest
import CreateRuleUI
import Miranda
from CreateRuleUI import CreateRuleEditor

class Test(unittest.TestCase):

#    def test_set_rule_setting(self):
#        
#        ruleSetting = Miranda.RuleSetting();
#        ruleSetting.description = 'My Configuration'
#        ruleSetting.enabled = True;
#        ruleSetting.confirm_action = True;
#        ruleSetting.recursive = True;
#        ruleSetting.source_folder = 'source folder';
#        
#        createRuleEditor = CreateRuleUI.CreateRuleEditor('../src/CreateRule.glade');
#        createRuleEditor.set_rule_setting(ruleSetting);
#        
#        self.assertEqual('My Configuration',createRuleEditor.descTxtField.get_text());
#        self.assertTrue(createRuleEditor.enabled_check_box.get_active());
#        self.assertTrue(createRuleEditor.confirm_action_check_box.get_active());
#        self.assertTrue(createRuleEditor.recursive_check_box.get_active());
#        self.assertEqual('source folder',createRuleEditor.source_folder.get_text());

    def test_add_rule_box(self):
        
       rule_subject = Miranda.RuleSubject();
       rule_subject.file_component_type = Miranda.FILE_EXT
       rule_subject.criteria = Miranda.IS
       rule_subject.value = "file"
       
       create_rule_editor = CreateRuleUI.CreateRuleEditor('../src/CreateRule.glade');
       create_rule_editor.__add_rule_box__(True, rule_subject);
       
       
       
       
if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.test_set_rule_setting']
    unittest.main()